  <style>
  .image-placeholder img { max-height:200px;}
  .doc {
  overflow: auto;
  
  border: 1px solid black;
  height: 500px;
  }
  
  </style>
  <div class="users form">
  
  <div class="row">
	  <div class="col-md-12">
		  <div class="page-header">
			  <h1><?php echo __('Admin Edit User'); ?></h1>
		  </div>
	  </div>
  </div>
  
  
  
  <div class="row">
  <?php echo $this->element('admin-menu'); ?>
	  <div class="col-md-9">
		  <?php echo $this->Form->create('User', array('role' => 'form','type' => 'file')); ?>
  
			  <div class="form-group">
				  <?php echo $this->Form->input('id', array('class' => 'form-control', 'placeholder' => 'Id'));?>
			  </div>
			  <div class="form-group">
				  <?php echo $this->Form->input('first_name', array('class' => 'form-control', 'placeholder' => 'First Name'));?>
			  </div>
			  <div class="form-group">
				  <?php echo $this->Form->input('last_name', array('class' => 'form-control', 'placeholder' => 'Last Name'));?>
			  <div class="form-group">
				  <?php echo $this->Form->input('email', array('class' => 'form-control', 'placeholder' => 'Email'));?>
			  </div>
			  </div>
			  <div class="form-group">
				<div class="image-placeholder">
				  <?php 
				  if(!empty($user['User']['image'])){
				  $image	=	'/files/user/'.$user['User']['image'];
				  echo $this->Html->image($image,array('alt'=>'',"class"=>"image-placeholder"));
				  }
				  else
				  {
					  echo ' <img src="" class="image-placeholder" id="agent-image" alt="Image"/>';
				  }
				   ?>                  
				
				 </div>
				  <?php echo $this->Form->input('image', array('label'=>'image','type' => 'file')); ?>
			  </div>
			  <hr />
			  <br /><br />
			  <div class="form-group">
				  <?php 
				  if(!empty($user['User']['documents'])){
				  $doc	=	'/files/user_doc/'.$user['User']['documents']; 
				  $file_parts = pathinfo($doc);
							  if(strtolower($file_parts['extension'])=='pdf'){
							  ?>
							  <object data="<?php echo $this->Html->url($doc); ?>" type="application/pdf" width="100%" height="500">
							  alt : <a href="<?php echo $this->Html->url($doc); ?>">PDF Documents</a>
							  </object>
							  <?php
						  }
						  else
						  {
							  echo '<div  class="doc">';
						  echo $this->Html->image($doc,array('alt'=>'',"class"=>"image-doc"));
						  echo '</div>';
  
						  }
				  }
				  
				  if(($user['User']['user_role']=='agent') or ($user['User']['user_role']=='broker_admin'));
				  echo $this->Form->input('documents', array('label'=>'Documents (.pdf, .jpg, .jpeg, .png, gif)','type' => 'file','class' => 'form-control', 'placeholder' => 'Documents'));
				  
				   ?>                  
			  </div>
			  <hr />
			  <br /><br />
			  <div class="form-group">
				  <?php echo $this->Form->input('new_password', array('class' => 'form-control', 'placeholder' => 'New Password'));?>
			  </div>
  
			  <div class="form-group">
				  <?php echo $this->Form->input('mobile_phone', array('class' => 'form-control', 'placeholder' => 'Mobile Phone'));?>
			  </div>
			  <div class="form-group">
				  <?php echo $this->Form->input('work_phone', array('class' => 'form-control', 'placeholder' => 'Work Phone'));?>
			  </div>
			  <div class="form-group">
				  <?php echo $this->Form->input('facebook', array('class' => 'form-control', 'placeholder' => 'Facebook URL'));?>
			  </div>
			  <div class="form-group">
				  <?php echo $this->Form->input('twitter', array('class' => 'form-control', 'placeholder' => 'Twitter URL'));?>
			  </div>
			  <div class="form-group">
				  <?php echo $this->Form->input('google_plus', array('class' => 'form-control', 'placeholder' => 'Google plus URL'));?>
			  </div>
			  <div class="form-group">
				  <?php echo $this->Form->input('linkedin', array('class' => 'form-control', 'placeholder' => 'Linkedin URL'));?>
			  </div>
			  <div class="form-group">
				  <?php echo $this->Form->input('description', array('class' => 'form-control', 'placeholder' => 'description'));?>
			  </div>
  
			  <div class="form-group">
				  <?php 
				  echo $this->Form->input('active', array('class' => 'form-control', 'placeholder' => 'Active'));
					  echo '<div class="alert alert-warning"><b>Note:</b> Not active agent/Broker can login in to his/her account. Also his/her (account and his property) can not be dislayed in front end</div>';
				  
				  ?><hr />
				  <?php 
				  
				  if(($user['User']['user_role']=='agent') or ($user['User']['user_role']=='broker_admin')){
					  echo $this->Form->input('approved', array('class' => 'form-control', 'placeholder' => 'approved'));
					  echo '<div class="alert alert-warning"><b>Note:</b> Not Approved agent/Broker can be login to his/her account. 
					  But his/her (account and his property) can not be dislayed in front end.
					  Approve Agent/Broker if agent/broker documents are valid.
					  </div>';
				  }
				  
				  ?>
			  </div>
			  <hr />
			  <div class="form-group">
				  <?php echo $this->Form->submit(__('Submit'), array('class' => 'btn btn-primary btn-lg')); ?>
			  </div>
  
		  <?php echo $this->Form->end() ?>
  
	  </div><!-- end col md 12 -->
  </div><!-- end row -->
  </div>
